{template '../../header'}
{template '../../left'}

<div class="card">
    <div class="card-header">
        栏目管理
    </div>
    <div class="card-body">
        <div class="row mb-3">
            <div class="col-12">
                <a href="/admin/cms/column/edit" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> 添加</a>
            </div>
        </div>
        <form method="post">
            <table class="table table-sm table-striped table-hover">
                <thead>
                    <tr>
                        <th>
                            ID
                        </th>
                        <th>
                            栏目图片
                        </th>
                        <th>
                            栏目名称
                        </th>
                        <th>
                            栏目标识
                        </th>
                        <th>
                            栏目简称
                        </th>
                        <th>
                            是否显示
                        </th>
                        <th>
                            栏目类型
                        </th>
                        <th>
                            栏目排序
                        </th>
                        <th>
                            修改
                        </th>   
                        <th>
                            删除
                        </th>   
                    </tr>
                </thead>
                <tbody>
                    {loop $rows $row}
                    <tr>
                        <td>
                            {$row['id']}
                        </td>
                        <td>
                            <img src="{$row['thumb']}" style="width: 2rem; height: 1.5rem;" />
                        </td>
                        <td>
                            {$row['title']}
                        </td>
                        <td>
                            {$row['name']}
                        </td>
                        <td>
                            {$row['short']}
                        </td>
                        <td>
                            {$row['state_title']}
                        </td>
                        <td>
                            {$row['type_title']}
                        </td>
                        <td>
                            <input type="text" class="form-control form-control-sm" name="sorts[{$row['id']}]" value="{$row['sort']}" size="5" />
                        </td>
                        <td>
                            <a class="btn btn-success btn-sm" href="/admin/cms/column/edit?id={$row['id']}"><i class="fa fa-edit"></i></a>
                        </td>
                        <td>
                            <button type="button" class="btn btn-danger btn-sm" onclick="confirm('确定要删除栏目吗？') && (location.href='/admin/cms/column/remove?id={$row['id']}')"><i class="fa fa-trash-o"></i></button>
                        </td>
                    </tr>
                    {/loop}
                </tbody>
            </table>
            <div class="row">
                <div class="col-12">
                    <button type="submit" class="btn btn-primary btn-sm" name="do" value="sort" ><i class="fa fa-sort-amount-desc"></i> 保存排序</button>
                </div>
            </div>
        </form>
    </div>
</div>

{template '../../footer'}   